var Q = require('q');

function t(){
    var deferred = Q.defer();
    deferred.reject(new Error("test error"));
    return deferred.promise;
}

t().then(
        function(){

        }
    )
    .then(
        function(){

        },function(e){
            console.log(e);
        }
    )


